package javavis.jip3d.geom;

import java.io.IOException;
import java.io.StreamTokenizer;

import javax.vecmath.Color3b;

import cern.colt.matrix.impl.DenseDoubleMatrix1D;

/**
 * 
 * @author dviejo
 *
 */
public class PointSR4K extends Point3D {
	private static final long serialVersionUID = -4341775468110824954L;

	/**
	 * @uml.property  name="confidence"
	 */
	public int confidence;
	
	public PointSR4K() {
		super();
		confidence = 0;
	}

	public PointSR4K(PointSR4K source) {
		super(source);
		this.confidence = source.confidence;
	}

	public PointSR4K(StreamTokenizer st) {
		double x,y,z;
		byte col;
		int i,j;
		visited = 0;

		try
		{
			st.nextToken();
			x = st.nval;
			st.nextToken();
			y = st.nval;
			st.nextToken();
			z = st.nval;

			st.nextToken();
			col = (byte) ((int)st.nval&0xFF);

			st.nextToken();
			confidence = (int) st.nval;

			st.nextToken();
			i = (int) st.nval;
			st.nextToken();
			j = (int) st.nval;

			data = new DenseDoubleMatrix1D(4);
			data.set(0, x);
			data.set(1, y);
			data.set(2, z);
			data.set(3, 1);
			color = new Color3b(col, col, col);
			posx = j;
			posy = i;
		} catch (IOException e)
		{
			System.out.println("Error reading Point3D from file");
		}
	}

	public PointSR4K(double x, double y, double z) {
		super(x, y, z);
	}

	public PointSR4K(double x, double y, double z, Color3b col, int confidence, int i, int j) {
		super(x, y, z, col, i, j);
		this.confidence = confidence;
	}

	public PointSR4K(double[] coords) {
		super(coords);
	}

}
